package work2;

import Uti.ScannerUti;

public class Works2 {
    public static void Work() {
        while (true) {
            System.out.println("请选择题目序号：1——题目1： 2——题目2： 3——题目3： 4——题目4： 0——退出");
            int kk = ScannerUti.getInt();

            if (kk == 1) doWork1();
            else if (kk == 2) doWork2();
            else if (kk == 3) doWork3();
            else if (kk == 4) doWork4();
            else if (kk == 0) break;
        }
    }

    public static void doWork1() {
        Mobile mobile = new Mobile();
        System.out.println(mobile.toString());
    }

    public static void doWork2() {
        Double max= (double) Byte.MAX_VALUE;
        Double min= (double) Byte.MIN_VALUE;

        System.out.println("byte的数据总数："+(max-min+1));
        System.out.println("byte的取值范围："+min+"~"+max);
        System.out.println("将字符串127转换为byte类型："+Byte.parseByte("127")+"\n");
        Double maxInt=(double)Integer.MAX_VALUE;
        Double minInt=(double)Integer.MIN_VALUE;
        System.out.println("Int的数据总数："+Double.valueOf(maxInt-minInt+1));
        System.out.println("Int的取值范围："+minInt+"~"+maxInt);
        System.out.println("将字符串50000转换为int类型："+Integer.parseInt("50000"));
        System.out.println("16转换为2进制"+Integer.toBinaryString(16));
        System.out.println("16转换为16进制"+Integer.toHexString(16)+"\n");
    }

    public static void doWork3() {
        MyDate day = new MyDate();
        day.printDate();
    }

    public static void doWork4() {
        new GradeAdmin();
    }
}
